namespace ApplicationControllerExample.Infrastructure
{
    using System.Windows.Forms;
    using Views.Main;
    using StructureMap;

    public class AppContext : ApplicationContext
    {
        public AppContext(IContainer container)
        {
            Container = container;
            MainForm = GetMainForm();
        }

        private IContainer Container { get; set; }

        private Form GetMainForm()
        {
            var mainForm = new MainView();
            Container.Inject<IMainView>(mainForm);
            Container.GetInstance<MainPresenter>();
            return mainForm;
        }
    }
}